/**
 * Created by Administrator on 2017/3/10.
 */
var Countdown = require('../../../src/libs/countdown');

var Root = React.createClass({
    onClick:function(){
        this.refs.clock.stop();
    },
    onStart:function(){
        this.refs.clock.start();
    },
    render:function(){
        var time = new Date().getTime() + 100000;
        return(
            <div>
                <Countdown ref="clock" timeRemaining={new Date(time)} tpl="{d}天{h}小时{m}分{s}秒"/>
                <button onclick={this.onClick.bind(this)}>停止</button>
                <button onclick={this.onStart.bind(this)}>开始</button>
                <Countdown ref="clock1" timeRemaining="2017/04/07" tpl="{d}天{h}小时{m}分{s}秒"/>
            </div>
        )
    }
});
ReactDOM.render(<Root/>, document.getElementById('main'));